package cn.ggcms.cms.biz;

import java.util.List;

import org.hibernate.criterion.Criterion;
import org.hibernate.criterion.Restrictions;

import cn.ggcms.cms.dao.LinksDao;
import cn.ggcms.cms.vo.Links;

public class LinksBiz implements LinksDao {

	private LinksDao linksDao ;
	
	public void setLinksDao(LinksDao linksDao) {
		this.linksDao = linksDao;
	}

	public boolean doDeleteLink(int id) {
		return this.linksDao.doDeleteLink(id);
	}

	public int doInsertLink(Links links) {
		return this.linksDao.doInsertLink(links);
	}

	public boolean doUpdateLinks(Links links) {
		return this.linksDao.doUpdateLinks(links);
	}

	public List<Links> findLinks() {
		return this.linksDao.findLinks();
	}

	public Links findLinksById(int id) {
		return this.linksDao.findLinksById(id);
	}

	public List<Links> searchLinks(Links links) {
		return this.searchLinks(Restrictions.like("hostName","%"+links.getHostName()+"%"));
	}

	public List<Links> searchLinks(Criterion... criteria) {
		return this.linksDao.searchLinks(criteria);
	}

}
